<?php
class Cookie extends base {
	static function is_set($name) {
		return isset($_COOKIE[C('cookie_prefix')][$name]);
	} 
	static function get($name) {
		return isset($_COOKIE[C('cookie_prefix')][$name]) ? $_COOKIE[C('cookie_prefix')][$name] : null;
	} 
	static function set($name, $value, $expire = 0, $path = '/', $domain = '') {
		!$domain && $domain = C('cookie_domain');
		$expire && $expire += now();
		setcookie(C('cookie_prefix') . '[' . $name . ']', $value, $expire, $path, $domain);
	} 
	static function del($name, $path = '/', $domain = '') {
		!$domain && $domain = C('cookie_domain');
		self :: set($name, '', now() - 3600, $path, $domain);
	} 
}